<script setup>
import { ref } from "vue"
import { useRouter } from "vue-router"

const router = useRouter()


// 切换墙
const changeWall = (index) => {
    router.push({
        query: {
            id: index
        }
    })
}

</script>

<template>
    <div class="header">
        <div class="logo">
            <img src="@/assets/images/yksg.svg" alt="" />
            <div class="logo-title">一刻时光</div>
        </div>
        <div class="menu">
            <div class="message" :class="{active: $route.query.id == 0}" @click="changeWall(0)">留言墙</div>
            <div class="pic" :class="{active: $route.query.id == 1}" @click="changeWall(1)">照片墙</div>
        </div>
        <!-- <div class="user">
            <div class="user-header"></div>
        </div> -->
    </div>
</template>

<style lang="less" scoped>
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(20px);
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 999;

    .logo {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 30px;

        .logo-title {
            display: inline-block;
            line-height: 52px;
            font-family: PingFangSC-Semibold;
            font-size: 20px;
            font-weight: 600;
            margin-left: 10px;
        }
    }

    .menu {
        margin: auto;
        display: flex;
        align-items: center;
        position: absolute;
        left: 50%;
        transform: translate(-50%);

        .message,
        .pic {
            width: 82px;
            height: 36px;
            line-height: 36px;
            text-align: center;
            margin-right: 5px;
            cursor: pointer;
        }

        .active {
            background: #3B73F0;
            border-radius: 20px;
            color: #fff;
            font-family: PingFangSC-Semibold;
            font-weight: 600;
        }
    }

    .user {
        .user-header {
            border-radius: 50%;
            width: 36px;
            height: 36px;
            background: linear-gradient(180deg, #7BE7FF, #1E85E2);
            margin-right: 30px;
        }
    }
}
</style>
